home *** CD-ROM | disk | FTP | other *** search
- Path: red5.cac.washington.edu!atb
- From: "Aaron T. Baldie" <atb@cac.washington.edu>
- Newsgroups: comp.lang.c
- Subject: HELP! Please! Why doesn't this work
- Date: Thu, 15 Feb 1996 13:37:48 -0800
- Organization: University of Washington
- Message-ID: <Pine.ULT.3.91a.960215131933.614A-100000@red5.cac.washington.edu>
- NNTP-Posting-Host: red5.cac.washington.edu
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
-
- #include <stdio.h>
- #include <malloc.h>
-
- [=>/***************************************************************/
- [=>void initialize_array(char **solution, int size){
- [=> int row, col;
- [=> for(row = 0; row < size; row++){
- [=> for(col = 0; col < size; col++){
- [=> solution[row][col] = 'w';
- [=> }
- [=> }
- [=>
- [=>}
- [=>
- [=>/***************************************************************/
- void print_maze(char **maze, int size){
- int row, col;
-
- for (row = 0; (row<size); row++){
- for (col = 0; (col<size); col++){
- printf("%c", maze[row][col]);
- }
- printf("\n");
- }
- }
-
- /***************************************************************/
- main()
- {
- char **solution_array;
- int size, row, col;
- size = 20;
- solution_array = (char **) malloc(size);
- for (row=0; row<size; row++){
- solution_array[row] = (char *) malloc(size);
- }
-
- initialize_array(solution_array, size);
- print_maze(solution_array, size)
- }
-
-
- Aaron Baldie
- atb@u.washington.edu
- http://weber.u.washington.edu/~atb/
- (206)543-5970
-
-
-
-